Don't activate GtkExpander if mouse dragged away
authorPhilip Chimento <philip.chimento@gmail.com>
Thu, 22 Aug 2013 05:03:02 +0000 (22:03 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 17 Sep 2013 02:43:02 +0000 (22:43 -0400)
Previously, when you clicked and held the button down on a
GtkExpander's label or disclosure triangle, then moved the mouse
away and released the button, the expander would still activate.
This brings the behavior in line with the more generally expected
behavior, as exhibited by GtkButton for example.

https://bugzilla.gnome.org/show_bug.cgi?id=706345

gtk/gtkexpander.c

index 60c82da1f75ac1a61b81c11da771bff7bf2b2e74..f725b05ffbcb8e6a72cf7fd6bb1343431f00d010 100644 (file)
@@ -1041,7 +1041,8 @@ gtk_expander_button_release (GtkWidget      *widget,
 
   if (event->button == GDK_BUTTON_PRIMARY && expander->priv->button_down)
     {
-      gtk_widget_activate (widget);
+      if (expander->priv->prelight)
+        gtk_widget_activate (widget);
       expander->priv->button_down = FALSE;
       return TRUE;
     }